package creatorMode.decorator;

public class run {
    public static void main(String[] args) {
        System.out.println("普通巨魔");
        Troll troll=new SimpleTroll();
        troll.attack();
        troll.fleeBattle();
        System.out.println("攻击能力"+troll.getAttackPower());
        System.out.println("==========普通巨魔获得棍棒能力==========");
        Troll clubbedTroll=new ClubbedTroll(troll);
        clubbedTroll.attack();
        clubbedTroll.fleeBattle();
        System.out.println("攻击能力"+clubbedTroll.getAttackPower());
        System.out.println("==========棍棒能力巨魔提升攻击和防御能力===========");
        Troll defenseAndClubbedTroll=new defenseTroll(clubbedTroll);
        defenseAndClubbedTroll.attack();
        defenseAndClubbedTroll.fleeBattle();
        System.out.println("攻击能力:"+defenseAndClubbedTroll.getAttackPower());
    }
}
